<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@ page import="com.chanyachting.emall.util.*" %>
<%@ page import="java.util.*" %>

<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.*" %>
<%@ page import="com.chanyachting.emall.serviceImpl.*" %>

<%

RequestUtil ru=new RequestUtil(request);

//获得商品类型
String productType=ru.getParameter("type","00");

%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title></title>

<script type="text/javascript" src="<%=root %>/js/jquery-1.3.2.min.js" charset="utf-8">//ADCRM</script>
<script type="text/javascript" src="<%=root %>/js/jquery.form.js" charset="utf-8">//ADCRM</script>

<script language="javascript" type="text/javascript">

	$(function(){

		$.ajaxSetup ({
		    cache: false //关闭AJAX相应的缓存
		});

		});


</script>


</head>

<body>
<div class="tab_box">
	<div class="tab_menu">
    	
        <a href="" class="current">
        <%
        		String actionName = "";
        		if ("00".equals(productType)) {
        			out.print("管理普通商品");
        			actionName = "nomalProductUpdate.do";
        		} else if ("01".equals(productType)) {
        			out.print("管理游艇销售");
        			actionName = "sellyachtEdit.do";
        		} else if ("02".equals(productType)) {
        			out.print("管理游艇租赁");
        			actionName = "rentyachtEdit.do";
        		} else if ("03".equals(productType)) {
        			out.print("管理码头俱乐部");
        			actionName = "dockEdit.do";
        		} else if ("04".equals(productType)) {
        			out.print("管理游艇展览");
        			actionName = "showyachtEdit.do";
        		} else if ("05".equals(productType)) {
        			out.print("管理帆船赛事");
        			actionName = "matchEdit.do";
        		}
        	%></a>
  
    </div>
	<div class="tab_submenu">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="50%"><div class="mu_title"><a href="product_nomal_list.jsp?type=<%=productType %>">产品展示中</a>｜
          <a href="product_nomal_under_list.jsp?type=<%=productType %>">待上架</a>｜
          <a href="product_nomal_public_list.jsp?type=<%=productType %>">推荐中</a></div></td>
          <td align="right">&nbsp;</td>
        </tr>
      </table>
	</div>
</div>

<div><%= new RequestUtil(request).getMsg() %></div>


<table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="yes_border">
  <tr>
    <th height="36" colspan="6" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="no_border">
      <tr>
        <td width="15%" height="36" align="center"><label></label>
              <input type="submit" name="button" id="button" value=" 下 架 " />
              <input type="submit" name="button2" id="button2" value=" 删 除 " /></td>
        <td align="center">&nbsp;</td>
        <td width="15%" align="center">&nbsp;</td>
      </tr>
    </table></th>
  </tr>
  <tr>
    <td colspan="5" align="center" bgcolor="#E7E7E7"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="no_border">
      <tr>
        <td width="15%" align="center"><label>
          <input type="checkbox" name="checkbox2" id="checkbox2" />
          </label>
          全选本页产品信息</td>
        <td align="center">&nbsp;</td>
        <td width="15%" align="center">本页显示 10条产品信息</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <th width="15%" align="center">编号</th>
    <th align="center">商品名称</th>
    
    <th width="15%" align="center">最后更新时间</th>
    <th width="15%" align="center">发布日期</th>
    <th width="15%" align="center">操作</th>
  </tr>
  
  <%
  	
  
  //从session中获得公司对象
	
	Company company=(Company)ru.getSessionObject(CompanyService.COMPANY_IN_SESSION,new Company());
	
  CompanyproductService compService = new CompanyproductServiceImpl();
	List<Companyproduct> prodList=compService.getUnderCompanyproductByCompany(company,productType);

  %>
  
  
  <%
  	if(prodList!=null && prodList.size()>0){
  		
  		Companyproduct cp=null;
  		
  		for(int i=0;i<prodList.size();i++){
  			
  			cp=(Companyproduct)prodList.get(i);
  %>
  <tr>
    <td align="center"><input type="checkbox" name="checkbox2" id="checkbox4" /><%=cp.getId() %></td>
    <td><%= cp.getName() %></td>
   
    <td align="center"><%= cp.getUpdateDate() %></td>
    <td align="center"><%= cp.getCreateDate() %></td>
    <td align="center">
    	<a href="<%=root %>/memberBackend/nomalProductRelease.do?cpid=<%=cp.getId() %>&type=<%=productType %>">上架</a>　
    	<a href="<%=root %>/memberBackend/<%=actionName %>?id=<%=cp.getId() %>" >编辑</a>　
    	<a href="<%=root %>/memberBackend/nomalProductDelete.do?cpid=<%=cp.getId() %>&type=<%=productType %>" onclick="return confirm('是否确认删除？');">删除</a>
    </td>
  </tr>
  
  <%
  		}
  		
  	}
  
  %>
  
 
  <tr>
    <td colspan="5" bgcolor="#E7E7E7"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="no_border">
      <tr>
        <td width="15%" align="center"><label>
          <input type="checkbox" name="checkbox2" id="checkbox2" />
          </label>
          全选本页产品信息</td>
        <td align="center">&nbsp;</td>
        <td width="15%" align="center">本页显示 10条产品信息</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="6"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="no_border">
      <tr>
        <td width="15%" height="36" align="center"><label></label>
              <input type="submit" name="button2" id="button7" value=" 下 架 " />
              <input type="submit" name="button2" id="button8" value=" 删 除 " /></td>
        <td align="center">&nbsp;</td>
        <td width="15%" align="center">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
<p>&nbsp;</p>
</body>
</html>

